// 请求响应参数（不包含data）
export interface Result {
  code: number;
  msg: string;
}

// 请求响应参数（包含data）
export interface ResultData<T = any> extends Result {
  statusCode: number;
  data: T;
}

// 分页响应参数
export interface ResPage<T> {
  data: any;
  list: T[];
  pageNum: number;
  pageSize: number;
  total: number;
}

// 分页请求参数
export interface ReqPage {
  pageNum: number;
  pageSize: number;
}

// 文件上传模块
export namespace Upload {
  export interface ResFileUrl {
    fileUrl: string;
  }
}

// 登录模块
export namespace Login {
  export interface ReqLoginForm {
    username: string;
    password: string;
  }
  export interface ResLogin {
    access_token: string;
  }
  export interface ResAuthButtons {
    [key: string]: string[];
  }
}

// 用户管理模块
export namespace User {
  export interface ReqUserParams extends ReqPage {
    username: string;
    gender: number;
    idCard: string;
    email: string;
    address: string;
    createTime: string[];
    status: number;
  }
  export interface ResUserList {
    id: string;
    username: string;
    gender: number;
    user: { detail: { age: number } };
    idCard: string;
    email: string;
    address: string;
    createTime: string;
    status: number;
    avatar: string;
    photo: any[];
    children?: ResUserList[];
  }
  export interface ResStatus {
    userLabel: string;
    userValue: number;
  }
  export interface ResGender {
    genderLabel: string;
    genderValue: number;
  }
  export interface ResDepartment {
    id: string;
    name: string;
    children?: ResDepartment[];
  }
  export interface ResRole {
    id: string;
    name: string;
    children?: ResDepartment[];
  }
}
//商品模块
export namespace Goods {
  export interface ReqGoodParams extends ReqPage {
    goodName: string;
    goodImg: string;
    goodPrice: number;
    goodCode: string;
    count: number;
    description: string;
  }
  export interface ResGoodList {
    id?: string;
    goodName: string;
    goodCode: string;
    goodPrice: number;
    count: number;
    description: string;
    goodImg: string;
    goodId?: string;
    specialIds?: string[] | number[] | string;
  }
  export interface ResStatus {
    userLabel: string;
    userValue: number;
  }
  export interface ResGender {
    genderLabel: string;
    genderValue: number;
  }
  export interface ResDepartment {
    id: string;
    name: string;
    children?: ResDepartment[];
  }
  export interface ResRole {
    id: string;
    name: string;
    children?: ResDepartment[];
  }
}
export namespace Specifications {
  export interface ReqSpecParams extends ReqPage {
    name: string;
  }
  interface specOptionsProps {
    id?: number;
    name?: string;
  }
  export interface ResSpecList {
    id: string;
    name: string;
    specOptions: specOptionsProps[];
  }
}
export namespace Units {
  export interface ReqSpecParams extends ReqPage {
    name: string;
  }
  export interface ResSpecList {
    id: string;
    name: string;
  }
}
export namespace Supplier {
  export interface ReqSpecParams extends ReqPage {
    name: string;
  }
  export interface ResSpecList {
    id: string;
    name: string;
    phone: string;
    type: number;
    address: string;
  }
}
export namespace Special {
  export interface ReqSpecParams extends ReqPage {
    name: string;
  }
  export interface ResSpecList {
    id: string;
    name: string;
  }
}

export namespace Cate {
  export interface ReqSpecParams extends ReqPage {
    name: string;
  }
  export interface ResSpecList {
    id: string;
    name: string;
  }
}
export namespace RecordType {
  export interface ReqSpecParams extends ReqPage {
    name: string;
  }
  export interface ResSpecList {
    id: string;
    name: string;
  }
}
export namespace GoodsRecord {
  export interface ReqSpecParams extends ReqPage {
    name: string;
  }
  interface InGoodsProps {
    id: string;
    name: string;
    Sku: Array<any>;
  }
  export interface ResSpecList {
    id: string;
    name: string;
    InGoods?: Array<InGoodsProps>;
    typeList: Array<any>;
  }
}
export namespace Statistics {
  export interface ReqSpecParams {
    timeArr: string[];
  }
  export interface ResSpecList {
    id: string;
    name: string;
    typeList: Array<any>;
  }
}
